package org.wu.framework.authorization.platform.infrastructure.entity;

import lombok.Data;
import lombok.experimental.Accessors;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableIndex;
import org.wu.framework.core.stereotype.LayerField;
import org.wu.framework.core.stereotype.LayerField.LayerFieldType;
import org.wu.framework.lazy.orm.core.stereotype.LazyTable;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableField;
import org.wu.framework.lazy.orm.core.stereotype.*;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableFieldId;
import java.lang.Long;
import java.lang.Boolean;
import java.lang.String;
/**
 * describe 角色权限关系 
 *
 * @author Jia wei Wu
 * @date 2025/08/03 01:55 下午
 * @see org.wu.framework.lazy.orm.core.persistence.reverse.lazy.ddd.DefaultDDDLazyInfrastructureEntity 
 **/
@Data
@Accessors(chain = true)
@LazyTable(tableName = "sys_role_permission",comment = "角色权限关系")
@Schema(title = "sys_role_permission",description = "角色权限关系")
public class SysRolePermissionDO {


    /**
     * 
     * 创建时间
     */
    @Schema(description ="创建时间",name ="createTime",example = "")
    @LazyTableField(name="create_time",comment="创建时间",defaultValue="CURRENT_TIMESTAMP",upsertStrategy = LazyFieldStrategy.NEVER,columnType="datetime",extra=" on update CURRENT_TIMESTAMP")
    private LocalDateTime createTime;

    /**
     * 
     * 关联ID
     */
    @Schema(description ="关联ID",name ="id",example = "")
    @LazyTableFieldId(name = "id", comment = "关联ID")
    private Long id;

    /**
     * 
     * 是否删除
     */
    @Schema(description ="是否删除",name ="isDeleted",example = "")
    @LazyTableField(name="is_deleted",comment="是否删除",columnType="tinyint(1)")
    private Boolean isDeleted;

    /**
     * 
     * 权限ID
     */
    @Schema(description ="权限ID",name ="permissionId",example = "")
    @LazyTableFieldUnique(name="permission_id",comment="权限ID")
    private String permissionId;

    /**
     * 
     * 用户ID
     */
    @Schema(description ="用户ID",name ="roleId",example = "")
    @LazyTableFieldUnique(name="role_id",comment="用户ID",columnType="bigint")
    private Long roleId;

    /**
     * 
     * 更新时间
     */
    @Schema(description ="更新时间",name ="updateTime",example = "")
    @LazyTableField(name="update_time",comment="更新时间",defaultValue="CURRENT_TIMESTAMP",upsertStrategy = LazyFieldStrategy.NEVER,columnType="datetime",extra=" on update CURRENT_TIMESTAMP")
    private LocalDateTime updateTime;

    /**
     * 
     * 区域ID
     */
    @Schema(description ="区域ID",name ="zoneId",example = "")
    @LazyTableField(name="zone_id",comment="区域ID",defaultValue="'0'",upsertStrategy = LazyFieldStrategy.NEVER,columnType="varchar(255)")
    private String zoneId;

}